import java.util.Scanner;

public class Test_4 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String str = scanner.nextLine();
        //把字符串转换为字符数组
        char[] chars =str.toCharArray();
        for(int i=0;i<chars.length;i++){
            //判断字符是大小还是小写
            if(chars[i]>=65 &&chars[i]<=90 ){
                //把大写变小写
                chars[i] = (char) (chars[i]+32);
            }else if(chars[i]>=97 &&chars[i]<=122){
                chars[i] = (char) (chars[i]-32);
            }
        }
         //把字符数组转为字符串
        String string_1 = String.valueOf(chars);

        System.out.println(str);
        System.out.println(string_1);

    }
}
